package com.pks.datacenter.entity.basic;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.utils.poi.SExcelField;
import com.pks.web.mybatis.entity.BasicEntity;

/**
 * 
 * @author pks
 * @version 2019年9月10日 
 */
@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "数据源属性信息" , index_normal = {"dbId","type"})
public class DbField extends BasicEntity {

	private static final long serialVersionUID = 3909131279763718537L;

	public static final int type_number = 1;
	public static final int type_string = 2;
	public static final int type_date = 3;
	
	@DBField(name = "dbId" , comment = "数据源编号")
	@DBQuery
	private Long dbId;

	@SExcelField(order = 1 , title = "数据库字段名称")
	@DBQuery(value = {"=" , "like"})
	@DBField(name = "enName" , comment = "属性/数据库字段名称" , length = 255)
	private String enName ;

	@SExcelField(order = 3 , title = "中文名称")
	@DBQuery(value = {"=" , "like"})
	@DBField(name = "chName" , comment = "中文名称" , length = 255)
	private String chName ;
	
	@DBField(comment = "别名，默认使用chName")
	private String aliasName;
	
	@DBField(name = "type" , comment = "属性类型  1-数字型  2-字符型  3-日期类型 ")
	@DBQuery
	private Integer type;
	
	@SExcelField(order = 2 , title = "数据库定义的列类型")
	@DBField(name = "column_type", comment = "数据库定义的列类型" , length = 255)
	private String column_type;
	
	@DBField(name = "orders" , comment = "排序号")
	private Long orders;
	
	public DbField() {
		super();
	}
	
	public DbField(Long dbId, String enName,String chName, Integer type,String column_type,Long orders) {
		super();
		this.dbId = dbId;
		this.enName = enName;
		this.chName = chName;
		this.type = type;
		this.column_type = column_type;
		this.orders = orders;
	}
	
	
}
